<template>
    <div class="account-switch">
        <c-wrap title="切换户号">
            <c-cell :data="data" title="切换户号"></c-cell>
        </c-wrap>
    </div>
</template>
<script>
    import CWrap from '../../components/CWrap'
    import CCell from '../../components/CCell'

    export default {
        components: {CWrap, CCell},
        data() {
            return {
                data: []
            }
        },
        methods: {
            loadData() {
                app.ajax.get(app.config.api.terminal.list, {}, (res) => {
                    this.data = res.data.list;
                    app.util.localStorage('terminalId', res.data.default);
                });
            }
        },
        mounted() {
            this.loadData();
        }
    }
</script>
